package com.project.service;

import com.project.dao.ExerciseRecordMapper;
import com.project.entity.ExerciseRecord;
import com.project.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional(rollbackFor = Exception.class)
@Service
public class ExerciseRecordServiceImpl extends BaseService implements ExerciseRecordService {
    @Autowired
    ExerciseRecordMapper exerciseRecordMapper;

    @Override
    public void add(ExerciseRecord exerciseRecord) {
        exerciseRecordMapper.insert(exerciseRecord);
    }

    @Override
    public void modify(ExerciseRecord exerciseRecord){
        exerciseRecordMapper.updateByanswerrecordid(exerciseRecord);
    }

    @Override
    public ExerciseRecord findbyAnswerrecordid(Integer answerrecordid){
        return exerciseRecordMapper.selectByanswerrecordid(answerrecordid);
    }
}
